﻿@model Occupie.Models.Student

<figure class="experience" id="experience">
    <figcaption>
        <h4 class="heading">Работни места</h4>
        <div>
            @* Jobs *@

            <div id="jobPartial">
                @Html.Partial("../Job/_JobPartial")
            </div>

            <div class="dialog" id="jobDialog" style="display: none;"></div>

            @* Jobs *@
            <div class="add-link">
                @Ajax.ActionLink("Добави", "AddJob", "Job", new AjaxOptions { HttpMethod = "GET", UpdateTargetId = "jobDialog", InsertionMode = InsertionMode.Replace, OnSuccess = "openJobPopup" })<br />
            </div>
        </div>
    </figcaption>
</figure>

<figure class="experience" id="experience">
    <figcaption>
        <h4 class="heading">Проекти</h4>
        <div>
            @* Projects *@
            <div id="projectsPartial">
                @Html.Partial("../Project/_ProjectPartial")
            </div>

            <div class="add-link">
                @Ajax.ActionLink("Добави", "AddProject", "Project", new AjaxOptions { HttpMethod = "GET", UpdateTargetId = "projectDialog", InsertionMode = InsertionMode.Replace, OnSuccess = "openProjectPopup" })<br />
            </div>

            <div class="dialog" id="projectDialog" style="display: none;"></div>
            @* Projects *@
        </div>
    </figcaption>
</figure>

<script type="text/javascript">
    $(document).ready(function () {
        $("#jobDialog").dialog(
            {
                autoOpen: false,
                width: 300,
                height: 'auto',
                modal: true
            }
        );
    });
    function openJobPopup() {
        $("#jobDialog").dialog("open");
    }

    function deleteJob(id) {
        $("#job" + id).remove();
    }

    $(document).ready(function () {
        $("#projectDialog").dialog(
            {
                autoOpen: false,
                width: 300,
                height: 'auto',
                modal: true
            }
        );
    });
    function openProjectPopup() {
        $("#projectDialog").dialog("open");
    }

    function deleteProject(id) {
        $("#project" + id).remove();
    }
</script>

<script>
    var curYear = '@DateTime.Now.Year';
    var curMonth = '@DateTime.Now.Month';
    var curDay = '@DateTime.Now.Day';


    $("#Jobs_0_StartDate").kendoDatePicker(
        {
            format: "dd MMMM yyyy",
            start: "century",
            depth: "month",
            culture: "bg-BG",
            value: new Date('@Model.GetDateOfBirth()'),
            max: new Date(curYear, curMonth - 1, curDay)
        });

</script>
